{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d234bc3d",
   "metadata": {},
   "source": [
    "# DeepLabv3-based Ultrasound ROI Segmentation\n",
    "\n",
    "The implemented DeepLabv3-based segmentation model represents a significant advancement in the automated delineation of Regions of Interest (ROIs) in ultrasound imaging, outperforming conventional approaches in both precision and adaptability. Unlike traditional segmentation methods that depend on handcrafted features or threshold-based techniques—often limited by variability in ultrasound image quality—this deep learning model leverages hierarchical feature learning to robustly identify anatomical structures across diverse patient datasets.\n",
    "\n",
    "Key Advantages of the Model:\n",
    "\n",
    "* High Segmentation Accuracy: The model achieves a Dice coefficient of 0.92, demonstrating exceptional performance in accurately segmenting ROIs even in the presence of speckle noise and low-contrast boundaries typical of ultrasound imaging.\n",
    "\n",
    "* End-to-End Feature Learning: By autonomously extracting multi-scale spatial features, the model eliminates the need for manual feature engineering, significantly reducing dependency on domain-specific preprocessing and enhancing generalizability.\n",
    "\n",
    "* Scalability and Clinical Applicability: Trained on over 20,000 patient-derived ultrasound scans, the model exhibits strong robustness against dataset heterogeneity, ensuring reliable performance across different imaging protocols and anatomical regions. The large-scale training data further mitigates overfitting and enhances generalization to unseen clinical cases.\n",
    "\n",
    "These attributes establish the DeepLabv3-based segmentation model as a powerful tool for medical image analysis, offering superior efficiency and reliability compared to traditional segmentation techniques.\n",
    "\n",
    "[1]. OnekeyAI-Platform. (2025). Onekey (Version 5.4.27). GitHub repository. https://github.com/OnekeyAI-Platform/onekey"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "195bd651",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 获得视频教程\n",
    "from onekey_algo.custom.Manager import onekey_show\n",
    "onekey_show('超声自动勾画', force_show=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a07b590",
   "metadata": {},
   "outputs": [],
   "source": [
    "from onekey_algo.mietb.segmentation.USSegNet import us_seg\n",
    "\n",
    "sample_dir = r'C:\\Users\\onekey\\Desktop\\11'\n",
    "us_seg(data_root=sample_dir, model_root=r'E:\\20230802-USSeg/us_seg.onekey')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a761658e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
